package main

import (
	"fmt"
	"go.uber.org/zap"
	"mxshop-api/order-web/global"
	"mxshop-api/order-web/initialize"
)

/*
*
启动入口
*/
func main() {
	//初始化日志
	initialize.InitLogger()

	//初始化配置
	initialize.InitConfig()
	//initialize.InitConfigLocal()

	//初始化路由文件
	routers := initialize.Routers()

	//4 初始化翻译
	if transError := initialize.InitTrans("zh"); transError != nil {
		panic(transError)
	}

	//初始化src的连接
	//initialize.InitSrvConn()
	initialize.InitSrvConnLb()

	port := global.ServerConfig.Port
	zap.S().Infof("启动服务器，端口:%d", port)
	err := routers.Run(fmt.Sprintf(":%d", port))
	if err != nil {
		fmt.Println("order web服务启动失败", err.Error())
	}
}
